package unit4.part12.employer;

import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        String text = scanner.next();
        String[] strs = text.split(";");
        Employer[] ems = new Employer[strs.length];
        for (int i = 0; i < strs.length; i++) {
            String str = strs[i];
            String[] param = str.split(",");
            ems[i] = new Employer(param[0], Integer.parseInt(param[1]), Integer.parseInt(param[2]));
        }
        text = scanner.next();
        String[] param = text.split(",");
        HR hr = new HR(param[0], Integer.parseInt(param[1]), Integer.parseInt(param[2]));

        for (Employer em : ems) {
            em.work();
        }
        hr.work();

        for (Employer em : ems) {
            hr.paySalary(em);
        }
        hr.paySalary(hr);
    }
}
